
How Enigma Worked
I can't be the only one who saw the imitation game and was
disappointed that we weren't shown how Turing's machine worked. It turns out it
was pretty complicated - but I can tell you how the German code maker Enigma
worked - and a bit of what had to happen to crack it.
The Design:
Above is a stationary
diagram of what an enigma engine would have looked like - let's start by
examining one of the wheel shaped rotors.
There are 26 contacts
with internal wiring that maps contacts to each other in such a way that if you
send a signal down one contact it will go down the wire and out another.

The first step to
cracking enigma was getting a hold of the designs for the device. This was done
quite early in the war.
But of course there was more to this - there were several rotors
in even the early edition of enigma, all wired together. Note that the wires
connecting the rotors were stationary, so you could move the rotor such that
its output connected to a different stationary input. Thereby connecting to a
different input in the adjacent rotor.

After passing through
all the rotors the signal would reach a stationary wheel - known as a
reflector. The reflector would loop the signal back into the system (through a
different contact) - the signal would pass through all of the rotors again,
then go all the way back. This would repeat several times.

So the user would click on their keyboard and send signals through the
machine - this would light a bulb corresponding to the new letter after several
cycles of scrambling. To make it even more confusing for any codebreakers - the
rotors would also move forward by one click every time a new keyboard key was
pressed.
This might take a few
re-readings to visualise, and we couldn't expect Nazi operators to remember all
of this reliably. This would have made the system useless - because operators
wouldn't be able to convert code back to German.
However you might have noticed that this process is reversible. If a wheel is
designed such that a wire runs from A to Z, it's clear that inputting Z will
spit out A. This also means that if A maps to K after many layers of scramblings, inputting K into an identical engine where the
wheels all start in the same positions, would give you A. The second engine
would also rotate every key-press, so the two calibrations would update in
sync.
Hopefully you can see
now that with the wiring inside the rotors combined with the wiring between
them, you just have to turn the rotors and the same input would map to a
different output - the diagram below gives an example of a possible input to
output pathway.
Calibration + the
ground setting:
The starting position
of the rotors was decided on and changed everyday.
Enigma would be set to this starting position at the beginning of every
message.
But of course the other operators had to be informed of the new
setting daily.
At the same time
every morning, the positions of the rotors would be sent out as a string of
characters representing which contacts were on the top of the rotors at the
beginning of each message. This information was always coded with the same
standard ground setting.
Perhaps you can see
the weakness inherent in this system - every morning thousands of similar
messages could be picked up - and all of them were coded the same way.
Adding the Plugboard:
Later a plugboard was
added to enigma - this essentially connected the inputs of different letters.
This a signal going through A for example could be redirected to go through D
(or whatever letter was suitable). In some ways this served a similar role to
another rotor - but one where the connections could be changed at will, so
stealing the designs of the plugboard wouldn't help.
'Heil bloody Hitler'
This story kind of
sounds like an urban myth and I was surprised to find that it was true. It
wasn't enough to break Enigma on its own - but it is true that a lot of the
messages picked up ended with these same 10 characters. It became possible to
assume that the last 10 characters of any code were code for Heil Hitler or
similar regular sign-offs. This made reverse engineering to find the initial
set up much easier. So after all the work that went
into designing it – Enigma was foiled in the end by basic human foolishness,
and thus WWII was shortened by 2 years. Thank god for
human incompetence.